import request from './request.js'
// const API = 'http://new_mkmh.test/api/';
const API = request.url
const api = {
  common: {
    upload: (data) => request.post(API + 'common/upload', data),
    sendCode: (data) => request.get(API + 'common/sendCode', data),
  },

  settings:{
    show:(data) => request.post(API+`settings`,data),
  },
  // 版本
  versions: {
    check: (data) => request.get(API + `versions/check`, data),
  },
  // 消息
  messages: {
    index: (data) => request.get(API + `messages`, data),
    readOne: (id, data) => request.post(API + `messages/${id}`, data),
    readAll: (data) => request.post(API + `messages/readAll`, data),
  },
  // 盲盒
  blindBox: {
    index: (data) => request.get(API + `blindBox`, data),
    show: (id, data) => request.get(API + `blindBox/${id}`, data),
    barrage: (id, data) => request.get(API + `blindBox/barrage/${id}`, data),
    draw: (data) => request.post(API + `blindBox/draw`, data), // 抽奖
    priceSpread: (data) => request.post(API + `blindBox/priceSpread`, data), // 价格差距
  },
  // 开盒流水
  blindBoxOrders: {
    show: (id, data) => request.get(API + `blindBoxOrders/${id}`, data),
    index: (data) => request.get(API + `blindBoxOrders`, data),
  },
  // 赠礼记录
  blindBoxGiveOrders: {
    index: (data) => request.get(API + `blindBoxGiveOrders`, data),
  },
  // 弹窗
  pops: {
    index: (data) => request.get(API + `pops`, data),
  },
  // 盒柜
  blindBoxOrderPrizes: {
    index: (data) => request.get(API + `blindBoxOrderPrizes`, data), // 盒柜
    show: (id, data) => request.get(API + `blindBoxOrderPrizes/${id}`, data), // 盒柜
    takeShow: (data) => request.get(API + `blindBoxOrderPrizes/takeShow`, data), // 盒柜提货列表
    exchangeShow: (data) => request.get(API + `blindBoxOrderPrizes/exchangeShow`, data), // 盒柜拒提列表
    giveShow: (data) => request.get(API + `blindBoxOrderPrizes/giveShow`, data), // 盒柜赠送列表
    give: (data) => request.post(API + `blindBoxOrderPrizes/give`, data), // 盒柜赠送
    exchange: (data) => request.post(API + `blindBoxOrderPrizes/exchange`, data), // 盒柜拒提
    order: (data) => request.get(API + `blindBoxOrderPrizes/order`, data), // 盒柜拒提确认订单
    back: (id, data) => request.post(API + `blindBoxOrderPrizes/back/${id}`, data), // 盒柜反悔
  },
  // 订单
  orders: {
    index: (data) => request.get(API + `orders`, data), // 提货订单
    show: (id, data) => request.get(API + `orders/${id}`, data), // 提货订单
    cancel: (id, data) => request.put(API + `orders/cancel/${id}`, data), // 提货订单
    receive: (id, data) => request.put(API + `orders/receive/${id}`, data), // 提货订单
    express: (id, data) => request.get(API + `orders/express/${id}`, data), // 提货订单
    edit: (id, data) => request.put(API + `orders/${id}`, data), // 提货订单
    del: (id, data) => request.del(API + `orders/${id}`, data), // 提货订单
    store: (data) => request.post(API + `orders`, data), // 提货订单
    count: (data) => request.get(API + `orders/count`, data), // 订单
  },
  // 金币账单
  balanceLogs: {
    index: (data) => request.get(API + `balanceLogs`, data), // 账户
  },
  // 充值面板
  rechargePanels: {
    index: (data) => request.get(API + `rechargePanels`, data), // 充值面板
  },
  // 钻石账单
  pointLogs: {
    index: (data) => request.get(API + `pointLogs`, data), // 账户
  },
  // 商品
  goods: {
    index: (data) => request.get(API + 'goods', data), // 商品列表
    show: (id, data) => request.get(API + `goods/${id}`, data), // 商品详情
    //show:(id,data) => request.get('http://192.168.1.7/api/goods/27',data), // 商品详情
    order: (data) => request.get(API + `goods/order`, data), // 从商品生成订单页数据
  },
  goodsCates: {
    index: (data) => request.get(API + 'goodsCates', data), // 商品分类列表
  },
  questionCate: {
    index: (data) => request.get(API + 'questionCates', data), // 问题分类
  },
  /*questions:{
    index:(data) => request.get(API+'questions',data), 			// 问题分类
    show:(id,data) => request.get(API+`questions/${id}`,data), // 问题详情
  },*/
  users: {
    login: (data) => request.post(API + 'users/login', data),
    logout: (data) => request.post(API + 'users/logout', data),
    update: (data) => request.put(API + 'users', data), // 登录
    show: (data) => request.get(API + 'users', data), // 用户信息
    search: (id, data) => request.get(API + `users/${id}`, data), // 搜索用户信息
    bind: (data) => request.post(API + 'users/bind', data),
    off: (data) => request.post(API + 'users/off', data), // 注销
  },
  // 收货地址
  userAddress: {
    index: (data) => request.get(API + 'userAddress', data), // 收货地址列表
    default: (data) => request.get(API + 'userAddress/default', data), // 收货地址
    show: (id, data) => request.get(API + `userAddress/${id}`, data), // 收货地址列表详情
    edit: (id, data) => request.put(API + `userAddress/${id}`, data), // 收货地址列表详情
    store: (data) => request.post(API + `userAddress`, data), // 收货地址列表详情
    del: (id, data) => request.del(API + `userAddress/${id}`, data), // 收货地址列表详情
    freight: (id, data) => request.get(API + `userAddress/freight/${id}`, data), // 根据地址判断运费
  },
  // 轮播其
  banners: {
    index: (data) => request.get(API + 'banners', data),
  },
  // 签到面板
  signPanels: {
    index: (data) => request.get(API + 'signPanels', data),
  },
  // 提现
  cashs: {
    index: (data) => request.get(API + 'cashs', data), // 提现列表
    store: (data) => request.post(API + 'cashs', data), // 申请提现
  },
  contents: {
    show: (id, data) => request.get(API + `contents/${id}`, data), // 内容详情
  },
  settings: {
    show: (data) => request.get(API + `settings`, data), // 设置详情
  },
  // 签到
  userSigns: {
    store: (data) => request.post(API + `userSigns`, data),
  },
  // 商务合作
  cooperates: {
    store: (data) => request.post(API + `cooperates`, data),
  },
  // 意见反馈
  feedback: {
    store: (data) => request.post(API + `feedback`, data),
  },
  // 等级
  userLevels: {
    index: (data) => request.get(API + `userLevels`, data), //
  },
  //问题
  questions: {
    index: (data) => request.get(API + `questions`, data), // 问题
    list: (data) => request.get(API + `questions/list`, data), // 问题
    show: (id, data) => request.get(API + `questions/${id}`, data), // 问题
  },
  // 最近开出
  blindBoxOrderPrizeLogs: {
    index: (data) => request.get(API + `blindBoxOrderPrizeLogs`, data),
    log: (data) => request.get(API + 'blindBoxOrderPrizes/foldWinnerRecord', data),
  },
  // 充值赠礼
  rechargeRewards: {
    index: (data) => request.get(API + `rechargeRewards`, data),
    reward: (data) => request.post(API + `rechargeRewards`, data),
  },
  // 用户优惠券
  userCoupons: {
    index: (data) => request.get(API + `userCoupons`, data),
    show: (data) => request.get(API + `userCoupons/show`, data),
    give: (data) => request.post(API + `userCoupons/give`, data),
  },
  // 充值
  rechargeOrders: {
    store: (data) => request.post(API + `rechargeOrders`, data),
  },
  // vip签到
  userVipSigns: {
    store: (data) => request.post(API + `userVipSigns`, data),
  },
  // 每日领取优惠券
  couponPanels: {
    index: (data) => request.get(API + `couponPanels`, data),
    store: (data) => request.post(API + `couponPanels`, data),
  },
  // 每日任务
  tasks: {
    index: (data) => request.get(API + `tasks`, data),
    reward: (id, data) => request.post(API + `tasks/${id}`, data),
  },
  // 我的反悔卡3
  
  
  userBackCards: {
    index: (data) => request.get(API + `userBackCards`, data),
  },
  // 我的佣金
  userCommissions: {
    index: (data) => request.get(API + `userCommissions`, data),
  },
  // 提现
  userWithdraws: {
    index: (data) => request.get(API + `userWithdraws`, data),
    store: (data) => request.post(API + `userWithdraws`, data),
  },
  // 我的邀请奖励
  userInviteRewards: {
    index: (data) => request.get(API + `userInviteRewards`, data),
    child: (data) => request.get(API + `userInviteRewards/child`, data),
  },
  // 领主
  blindBoxRanks: {
    index: (data) => request.get(API + `blindBoxRanks`, data),
  },
  //
  userLevelLogs: {
    index: (data) => request.get(API + `userLevelLogs`, data), // 历史升级降级记录
    log: (data) => request.get(API + `userLevelLogs/log`, data), // 五日流水
  },
  // 福利屋
  welfareHouses: {
    // 福利屋首页
    index: (data) => request.get(API + 'wealRooms', data),
    // 创建房间
    create: (data) => request.post(API + 'wealRooms/create', data),
    // 获取商品列表
    goods: (page) => request.get(API + 'wealRoomsGoods?page=' + page),
    // 获取房间详情
    detail: (id) => request.get(API + 'wealRooms/' + id),
    // 创建历史记录
    createHistory: (data) => request.get(API + 'wealRooms/record', data),
    // 获取参与列表
    joinList: (data) => request.get(API + 'wealRoomsParticipation/participant', data),
    // 参与房间
    join: (data) => request.post(API + 'wealRooms/participation', data),
    // 获取房间参与人数
    num: (id) => request.get(API + 'wealRoomsParticipation/' + id),
    // 中奖记录
    winning: (data) => request.get(API + 'wealRoomsOrdersPrizes/drawRecord', data),
    // 参与历史记录
    joinHistory: (data) => request.get(API + 'wealRoomsOrdersPrizes/myParticipation', data),
    // 开奖
    open: (id) => request.get(API + 'wealRooms/draw/' + id),
    // 我的抽奖奖品记录
    order: (data) => request.get(API + 'wealRoomsOrdersPrizes/myDrawRecord', data),
    // 赠送列表
    giveShow: (data) => request.get(API + 'wealRoomsOrdersPrizes/giveShow', data),
    // 赠送
    give: (data) => request.post(API + 'wealRoomsOrdersPrizes/give', data),
    // 拒提列表
    exchangeShow: (data) => request.get(API + 'wealRoomsOrdersPrizes/exchangeShow', data),
    // 拒提
    exchange: (data) => request.post(API + 'wealRoomsOrdersPrizes/exchange', data),
    // 提货列表
    takeShow: (data) => request.get(API + 'wealRoomsOrdersPrizes/takeShow', data),
    // 订单页
    take: (data) => request.get(API + 'wealRoomsOrdersPrizes/order', data),
    // 商品详情
    show: (id) => request.get(API + 'wealRoomsOrdersPrizes/' + id),
    // 提交订单
    store: (data) => request.post(API + 'orders', data),
    // 已读
    read: (id) => request.get(API + 'wealRooms/insertNum?weal_rooms_id=' + id),
  },
  // 系统通知
  notifies: {
    // 获取通知
    index: () => request.get(API + 'systemAnnouncements'),
  },
  // 红包
  redPackets: {
    // 创建红包
    create: (data) => request.post(API + 'redPackets/create', data),
    // 领取红包
    receive: (data) => request.post(API + 'redPackets/receive', data),
    // 红包列表
    index: (data) => request.get(API + 'redPackets', data),
    // 红包详情
    detail: (id) => request.get(API + 'redPackets/' + id),
    // 领取记录
    record: (data) => request.get(API + 'redPackets/records', data),
  },
  // 爬塔
  towers: {
    // 首页
    index: (data) => request.get(API + 'climbTowers', data),
    // 抽奖
    draw: (data) => request.post(API + 'climbTowers/draw', data),
    // 宝箱商品
    prize: () => request.get(API + 'towerTreasureBoxPrizes'),
    open: () => request.post(API + 'climbTowers/openTreasure'),
    order: (data) => request.get(API + 'climbTowerOrderPrizes', data),
    take: (data) => request.get(API + 'climbTowerOrderPrizes/order', data),
    takeShow: (data) => request.get(API + `climbTowerOrderPrizes/takeShow`, data), // 盒柜提货列表
    exchangeShow: (data) => request.get(API + `climbTowerOrderPrizes/exchangeShow`, data), // 盒柜拒提列表
    giveShow: (data) => request.get(API + `climbTowerOrderPrizes/giveShow`, data), // 盒柜赠送列表
    give: (data) => request.post(API + `climbTowerOrderPrizes/give`, data), // 盒柜赠送
    exchange: (data) => request.post(API + `climbTowerOrderPrizes/exchange`, data), // 盒柜拒提
    store: (data) => request.post(API + 'orders', data),
    show: (id) => request.get(API + 'climbTowerOrderPrizes/' + id),
  },
  compounds: {
    prize: (data) => request.get(API + 'fusionPrizes', data),
    add: (data) => request.get(API + 'fusionPrizes/autoAdd', data),
    store: (data) => request.post(API + 'fusionPrizes/store', data),
    order: (data) => request.get(API + 'fusionOrderPrizes', data),
    take: (data) => request.get(API + 'fusionOrderPrizes/order', data),
    takeShow: (data) => request.get(API + `fusionOrderPrizes/takeShow`, data), // 盒柜提货列表
    exchangeShow: (data) => request.get(API + `fusionOrderPrizes/exchangeShow`, data), // 盒柜拒提列表
    giveShow: (data) => request.get(API + `fusionOrderPrizes/giveShow`, data), // 盒柜赠送列表
    give: (data) => request.post(API + `fusionOrderPrizes/give`, data), // 盒柜赠送
    exchange: (data) => request.post(API + `fusionOrderPrizes/exchange`, data), // 盒柜拒提
    show: (id) => request.get(API + 'fusionOrderPrizes/' + id),
  },
}

export default api